<?php
/*
 * 发送：
 * GET  http://localhost/restful/user  列出所有user
 * GET  http://localhost/restful/user/1    获取指定user
 * POST http://localhost/restful/user?name=张三&sex=男$age=11  添加一个user
 * PUT  http://localhost/restful/user/1?name=张三&sex=男$age=11  更新指定用户的信息（全部信息）
 * DELETE  http://localhost/restful/user/1 或者 删除指定user
*/
//数据操作类
require('Request.php');
//输出类
require('Response.php');
//连接数据库
Request::CreateConn();
//获取数据
$data = Request::getRequest();

$data_array = array( );
//将数据放入数组
while ($row = mysqli_fetch_array($data,MYSQLI_ASSOC)) {
	$data_array[] = $row;
}
//输出结果
Response::sendResponse($data_array);
